package com.pms.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.pms.entity.Contact;
import com.pms.entity.Project;
import com.pms.service.NewContactService;
import com.pms.util.GetSession;

public class ContactServlet extends HttpServlet {


	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		//String proid=request.getParameter("proid");
		Project pro = (Project)GetSession.getSession(request).getAttribute("pro");
		//System.out.println(proid);
		String proid=pro.getPro_id();
		
		
		List<Contact> con=new NewContactService().findByProId(proid);
		request.setAttribute("conList", con);
		
		request.getRequestDispatcher("/WEB-INF/contact.jsp").forward(request, response);
	}

}
